projects
/
babl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53c6182
)
babl: set babl_rel_avg_error to a high value on NaN
author
Øyvind Kolås
<pippin@gimp.org>
Mon, 25 Sep 2017 20:46:21 +0000
(22:46 +0200)
committer
Øyvind Kolås
<pippin@gimp.org>
Mon, 25 Sep 2017 20:46:24 +0000
(22:46 +0200)
In relation to bug #787441, if the sum of errors contain a nan the sum
is nan, we return pi as a much higher than expected average error to
indicate that this is not 0.0.
babl/babl-util.c
patch
|
blob
|
history
diff --git
a/babl/babl-util.c
b/babl/babl-util.c
index 9b08913676de1094349cf873edf40baddf4687c2..23c1513f9760eaf76113944a46609cffe35d50de 100644
(file)
--- a/
babl/babl-util.c
+++ b/
babl/babl-util.c
@@
-91,10
+91,12
@@
babl_rel_avg_error (const double *imgA,
for (i = 0; i < samples; i++)
error += fabs (imgA[i] - imgB[i]);
- if (error >= 0.000001)
+ if (error >= 0.00000
0
1)
error /= samples;
- else
+ else
if (error <= 0.0)
error = 0.0;
+ else
+ error = M_PI;
return error;
}